﻿using Serilog;
using Serilog.Events;

namespace PLM.ConfigurationCenter.Serilog {
    public static class LogInfoHelper {
        /// <summary>
        /// 
        /// </summary>
        private static readonly ILogger _logger;
        /// <summary>
        /// 
        /// </summary>
        static LogInfoHelper() {
            _logger = new LoggerConfiguration()
                         .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
                         .WriteTo.PostgreSQL($"", "logs")
                         .CreateLogger();
        }
        /// <summary>
        /// 记录日常日志
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="message"></param>
        /// <param name="info"></param>
        public static void WriteLog(string message) {
            _logger.Information(message);
        }

    }
}